﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/design.Master" CodeBehind="MyProfile.aspx.vb" Inherits="CakeThatIBaked.MyProfile" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="theheader">
        <asp:Label ID="lbl_name" runat="server" Text="Label"></asp:Label> 
        Profile
    </div>
    <div class="thecontainer">
        
            <asp:Label ID="play" runat="server"></asp:Label>
&nbsp;<asp:Button ID="btn_cashIn" runat="server" CausesValidation="False" Text="Cash in" />
            <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" >
            <HeaderTemplate>
            
            </HeaderTemplate>
            
            <ItemTemplate>
            
            <center><img src=<%# eval("ProfilePic") %> width = 200 height=200 /></center>
            You are at the <b> <%# Eval("RoleOfUser")%> </b> level.
            <br />
            You have <b><%# Eval("SumOfpoints")%></b> Cake Points (<%# getcpprogress(Eval("SumOfpoints"), Eval("RoleOfUser"))%>)
            <br />
            You have posted <b><%# Eval("CountOfCakeTitle")%></b> Cakes (<%# getcakep(Eval("CountOfCakeTitle"), Eval("RoleOfUser"))%>)
            <br />
            You cakes have an average Rating of <b><%# showavergae(Eval("AvgOfCakeRating"))%></b> (<%# getavg(Eval("AvgOfCakeRating"), Eval("RoleOfUser"))%>)
            <br />
            You have posted <b><%# Eval("CountOfComment")%></b> comments on Cakes (<%# getcommentp(Eval("CountOfComment"), Eval("RoleOfUser"))%>)
            <br />
            <%# tipsection(Eval("UserID"),Eval("RoleOfUser"))%>
            <br />
            Change Your Profile image here: (WARNING: Old Profile Images will be lost)
            <br />
                <asp:FileUpload ID="FileUpload1" runat="server" /><asp:Button ID="btn_pic" runat="server"
                    Text="Change Pic" /><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                        ErrorMessage="RequiredFieldValidator" Text="You need to include a picture" ControlToValidate="FileUpload1"></asp:RequiredFieldValidator>
            </ItemTemplate>
            </asp:Repeater>
            <asp:Label ID="lbl_warning" runat="server" 
                Text="You are still in trail mode. To get your Stats and be able to change your profile picture you must add a cake and a comment" 
                Visible="False"></asp:Label>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:CakeConnection %>" 
                ProviderName="<%$ ConnectionStrings:CakeConnection.ProviderName %>" 
                SelectCommand="SELECT [UserName], [ProfilePic], [UserId], [SumOfpoints], [RoleOfUser], [CountOfCakeTitle], [AvgOfCakeRating], [CountOfComment] FROM [ProfilePage] WHERE ([UserName] = ?)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="lbl_name" Name="UserName" PropertyName="Text" 
                        Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
        
       

       
    </div>

</asp:Content>
